//app.js
//初始登录状态
var initial_headmode = {
  "loginMark": "", //登录标记
  "reqDigest": "NmE5MzJkODdlODlhZGZmMWY1NDE5M2VhMGE0YTIxMTE=",
  "category": "3", //微信统一进入传递参数为3 
  "imei": "",
  "imsi": "",
  "phonetype": "",
  "timestamp": "1502951724089",
  "version": "2.0.1"
};
//开发地址 
var app_url = 'https://ssldev.jkscw.com.cn/bsky-miniprogram-dev';
//测试地址
//var app_url = 'https://ssldev.jkscw.com.cn/bsky-miniprogram-test';
//正式地址
//var app_url = 'https://apissl.jkscw.com.cn/bsky-miniprogram';
App({
  //随机密钥生成
  randomPassword: function (size){
    var seed = new Array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'm', 'n', 'p', 'Q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
      '2', '3', '4', '5', '6', '7', '8', '9'
    );//数组
    var seedlength = seed.length;//数组长度
    var createPassword = '';
    for (var i = 0; i < size; i++) {
      var j = Math.floor(Math.random() * seedlength);
      createPassword += seed[j];
    }
    return createPassword;
  },
  globalData: {
    //注册手机号码
    phone: null,
    //初始化登录信息
    InitialHeadmode: JSON.stringify(initial_headmode),
    //地址 
    wxurl: app_url,
    //登录状态
    LoginStatus: false,
    //随机私钥
    PrivateKey: null,
    //加密公钥
    PublicKey: null,
    //用于后台那些奇葩的传参方式
    data:null,
  }
})